package com.event;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

import org.apache.commons.codec.binary.Base64;



public class Test {

    public static void main(String[] args) throws IOException {
        File file = new File("E:\\api-plan3.png");
        
        
        InputStream in = new FileInputStream(file);
        byte[] bytes = new byte[in.available()];
        in.read(bytes);
       
        System.out.println(new String(Base64.encodeBase64(bytes)));
    }

}
